import request from '@/utils/request'

// 获取角色
export const getRoles = function(obj) {
  return request.get('/sys/role', { params: obj })
}
// 删除角色
export const delRole = function(id) {
  return request.delete('/sys/role/' + id)
}
// 添加角色
// data: { name, description }
export const addRoles = function(data) {
  return request.post('/sys/role', data)
}
// 编辑角色
// data: {id, name, description }
export const editRole = function(data) {
  return request.put('/sys/role/' + data.id, data)
}
